package com.longrou.base.base;

import com.zhouyou.http.model.ApiResult;

import java.io.Serializable;

/**
 * @Description: 基础返回结果
 * @Author: LongRou
 * @CreateDate: 2018 2018/3/13 15:55
 * @Version: 1.0
 **/
public class BaseResult<T> extends ApiResult<T>{
    /**
     * 状态码：200成功，其他为失败
     */
    public int status;

    /**
     * 成功为success，其他为失败原因
     */
    public String message;

    @Override
    public int getCode() {
        return status;
    }

    @Override
    public String getMsg() {
        return message;
    }


    @Override
    public boolean isOk() {
        return status == BaseResultEnum.SUCCESS.status;
    }

    @Override
    public String toString() {
        return "BaseResult{" +
                "status=" + status +
                ", message='" + message + '\'' +
                ", data=" + getData() +
                '}';
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
